import { POST, GET } from './helper'
import config from '@/config'

const common_api_prefix = config.proxy.common_api_prefix.prefix
const uip_api_prefix = config.proxy.uip_api_prefix.prefix

export default {
  /**
   * 授权码登录，获取token
   * */
  authLoginByCode(body = { params: {}, data: {}, headers: {} }) {
    return GET({ url: common_api_prefix + '/auth/oauth/token', ...body })
  },

  /**
   * 根据token拉取用户信息
   * */
  authGetUserInfo(body = { params: {}, data: {}, headers: {} }) {
    return GET({ url: common_api_prefix + '/metadata/v1/system/user/getInfo', ...body })
  },

  /**
   * 首页中 顶部bannerlist(获取分页数据)
   * */
  uipBannerlist(body = { params: {}, data: {}, headers: {} }) {
    return POST({ url: uip_api_prefix + '/api/v1/UipBanner/list', ...body })
  },

  /**
   * 首页中 顶部bannerlist(获取分页数据)
   * */
  imageGet(body = { params: {}, data: {}, headers: {} }) {
    return GET({ url: uip_api_prefix + '/image/get', ...body, responseType: 'blob', timeout: 30 * 1000 })
  }
}
